var _glb={};






_glb.baseurl='http://www.5664.cn';






_glb.fileurl='http://files.3wmm.com';













//jquery-include






;(function(g){var c=[],b=[],f=0;function e(k,l){if(l.isCalled){return}var i=false;if(/webkit/i.test(navigator.userAgent)){if(k.sheet){i=true}}else{if(k.sheet){try{if(k.sheet.cssRules){i=true}}catch(j){if(j.code===1000){i=true}}}}if(i){setTimeout(function(){l()},1)}else{setTimeout(function(){e(k,l)},1)}}function d(i,j){if(i.attachEvent){i.attachEvent("onload",j)}else{setTimeout(function(){e(i,j)},0)}}function h(i,k){var j=g("<link/>").attr("rel","stylesheet").attr("href",i);g(g("head")[0]).append(j);d(j[0],k)}function a(l,m){var k,p,n,j,o,v;m=m||0;l=l||0;k=b[l];if(k){n=k.func||null;p=k.dat||[];v=p.length}else{return}if(m>=v){n();return}j=p[m];o=function(){c.push(j.src);m++;a(l,m)};if(j.type=="css"){h(j.src,o)}else{g.getScript(j.src,o)}}g.include=function(q,r,n){r=r||null;n=n||0;var o=q.split(","),p=o.length,l,j,m,t,s,k;s=[];for(l=0;l<p;l++){j=g.trim(o[l]);if(j!=""){if(g.inArray(j,c)>-1){continue}m={};m.src=(n||j.indexOf("http://")>-1)?j:_glb.baseurl+"/"+j;m.type="."+(j.split(".")[j.split(".").length-1]).toLowerCase();m.type=m.type.indexOf(".css")>-1?"css":"js";s.push(m)}}t={};t.dat=s;t.func=r;b[f]=t;a(f);f++}})(jQuery);













//jquery-cookie






;(function(f,b,g){var a=/\+/g;function e(h){return h}function c(h){return decodeURIComponent(h.replace(a," "))}var d=f.cookie=function(p,o,u){if(o!==g){u=f.extend({},d.defaults,u);if(o===null){u.expires=-1}if(typeof u.expires==="number"){var q=u.expires,s=u.expires=new Date();s.setDate(s.getDate()+q)}o=d.json?JSON.stringify(o):String(o);return(b.cookie=[encodeURIComponent(p),"=",d.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join(""))}var h=d.raw?e:c;var r=b.cookie.split("; ");for(var n=0,k=r.length;n<k;n++){var m=r[n].split("=");if(h(m.shift())===p){var j=h(m.join("="));return d.json?JSON.parse(j):j}}return null};d.defaults={};f.removeCookie=function(i,h){if(f.cookie(i)!==null){f.cookie(i,null,h);return true}return false}})(jQuery,document);













//jquery-lazyload






;(function(a,b,c,d){var e=a(b);a.fn.lazyload=function(c){function i(){var b=0;f.each(function(){var c=a(this);if(h.skip_invisible&&!c.is(":visible"))return;if(!a.abovethetop(this,h)&&!a.leftofbegin(this,h))if(!a.belowthefold(this,h)&&!a.rightoffold(this,h))c.trigger("appear"),b=0;else if(++b>h.failure_limit)return!1})}var f=this,g,h={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"datasrc",skip_invisible:!0,appear:null,load:null};return c&&(d!==c.failurelimit&&(c.failure_limit=c.failurelimit,delete c.failurelimit),d!==c.effectspeed&&(c.effect_speed=c.effectspeed,delete c.effectspeed),a.extend(h,c)),g=h.container===d||h.container===b?e:a(h.container),0===h.event.indexOf("scroll")&&g.bind(h.event,function(a){return i()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,c.one("appear",function(){if(!this.loaded){if(h.appear){var d=f.length;h.appear.call(b,d,h)}a("<img />").bind("load",function(){c.hide().attr("src",c.attr(h.data_attribute))[h.effect](h.effect_speed),b.loaded=!0;var d=a.grep(f,function(a){return!a.loaded});f=a(d);if(h.load){var e=f.length;h.load.call(b,e,h)}}).attr("src",c.attr(h.data_attribute))}}),0!==h.event.indexOf("scroll")&&c.bind(h.event,function(a){b.loaded||c.trigger("appear")})}),e.bind("resize",function(a){i()}),/iphone|ipod|ipad.*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent.persisted&&f.each(function(){a(this).trigger("appear")})}),a(b).load(function(){i()}),this},a.belowthefold=function(c,f){var g;return f.container===d||f.container===b?g=e.height()+e.scrollTop():g=a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return f.container===d||f.container===b?g=e.width()+e.scrollLeft():g=a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return f.container===d||f.container===b?g=e.scrollTop():g=a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return f.container===d||f.container===b?g=e.scrollLeft():g=a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!a.rightoffold(b,c)&&!a.leftofbegin(b,c)&&!a.belowthefold(b,c)&&!a.abovethetop(b,c)},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})})(jQuery,window,document);













;(function(a){a.event.special.textchange={setup:function(){a(this).data("lastValue",this.contentEditable==="true"?a(this).html():a(this).val());a(this).bind("keyup.textchange",a.event.special.textchange.handler);a(this).bind("cut.textchange paste.textchange input.textchange",a.event.special.textchange.delayedHandler)},teardown:function(){a(this).unbind(".textchange")},handler:function(){a.event.special.textchange.triggerIfChanged(a(this))},delayedHandler:function(){var c=a(this);setTimeout(function(){a.event.special.textchange.triggerIfChanged(c)},






 25)},triggerIfChanged:function(a){var b=a[0].contentEditable==="true"?a.html():a.val();b!==a.data("lastValue")&&(a.trigger("textchange",[a.data("lastValue")]),a.data("lastValue",b))}};a.event.special.hastext={setup:function(){a(this).bind("textchange",a.event.special.hastext.handler)},teardown:function(){a(this).unbind("textchange",a.event.special.hastext.handler)},handler:function(c,b){b===""&&b!==a(this).val()&&a(this).trigger("hastext")}};a.event.special.notext={setup:function(){a(this).bind("textchange",






 a.event.special.notext.handler)},teardown:function(){a(this).unbind("textchange",a.event.special.notext.handler)},handler:function(c,b){a(this).val()===""&&a(this).val()!==b&&a(this).trigger("notext")}}})(jQuery);




















//jquery-mydiy






;(function($){






	function gettime(){






		return new Date().getTime();






	}






	$.addfav=function(tit,url){






		var b=tit||"5664小游戏",a=url||"http://www.5664.cn?favorite";






		try{ window.external.addFavorite(a,b)}catch(c){ try{window.sidebar.addPanel(b,a,"")}catch(c){ alert("您的浏览器不支持该功能哦，请使用 Ctrl+D 收藏本页面")}}






	};






	$.bshare=function(id,url,cfg){






		if($(id).length>0 && $('#bdshare_js').length>0 && $('#bdshell_js').length>0 ){






			var defcfg={






				'bdDes':document.title,






				'bdText':'最新最全的Flash小游戏在线玩，狠值得来试玩！',






				'bdComment':'这小游戏网站不错，很给力！推荐给大家玩一下。',






				'bdPic':'',






				'searchPic':1,






				'wbUid':''






			};






			window.bds_config=$.extend({},defcfg,cfg);






			$(id).html('<div id="bdshare" class="bdshare_t" data="{\'url\':\''+url+'\'}"><a class="bds_qzone"></a><a class="bds_renren"></a><a class="bds_tsina"></a><a class="bds_tqq"></a><span class="bds_more" id="bds_more"></span></div>');






			$('#bdshare_js').attr('data',"type=tools&amp;uid=645380");






			$('#bdshell_js').attr('src',"http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours());






		}






	};






    $.hits=function(type,id,callback){






		return ;






		$.ajax({






			type:"get",






			url:_glb.baseurl+'/i/7323.php',






			data:{tn:'cmshits',type:type,id:id,h:gettime()},






			dataType:'jsonp',






			success:function(dat){






				if($.isFunction(callback)){






				    callback(dat);






				}






			}






		});






	};






	$.ImgLazy=function(id,isobj){






		var methods;






        methods={






			init:function(id,isobj){






				var self,obj,imgs;






				self=this;






				isobj=isobj||0;






				obj= isobj ? id : $(id);






				if(obj.length<1 || obj.data('load')==1){






					return ;






				}






				imgs=$('img',obj);






				$.each(imgs,function(i,n){






					var img,src=$(n).attr('_src')||'';






					if(src!=''){






						$('<img src="'+src+'"/>').load(function(){






							$(n).attr('src',src);






						});






					}






				});






				obj.data('load',1);






				return self;






			}






		};






		return methods.init(id,isobj);






	};






	$.GameSearch=function(){






		$('#bar .adfv').click(function(e){






			e.preventDefault();






			$.addfav();






		});






		$('#bar .desk').click(function(e){






			e.preventDefault();






			location.href=_glb.baseurl+'/desktop.php?a=desktop'+'&h='+new Date().getTime();






		});






		var ts,tp,bs,bp;






		ts=$('#bar .search');






		tp=$('input',ts);






		$('.submit',ts).click(function(){






			if($.trim(tp.val()) == ''){






				tp.focus();






				return false;






			}






			return true;






		});






	};






	$.TopCmd=function(){






		var wrp,page,list,game,pre,nxt,maxw,onew,most,now,move,cc;






		wrp=$('#topcmd');






		if(wrp.length<1){






			return ;






		}






		page=wrp.hasClass('topcmd2') ? 12 : 24;






		list=$('.list',wrp);






		game=$('.sgamelist',wrp);






		pre=$('.prev',wrp);






		nxt=$('.next',wrp);






		






		onew=list.width();






		most=$('li',game).length/page;






		cc=Math.floor(most);






		most = cc<most ? cc+1 : cc;






		maxw=most*onew;






		game.width(maxw);






		now=0;






		move=function(i){






			game.animate({left:-1*now*onew},200);






		};






		pre.click(function(){






			if(now>0){






				now--;






				move();






			}






		});






		nxt.click(function(){






			if(now<most-1){






				now++;






				move();






			}






		});






	};






	$.TopTo=function(v){






		v=v||0;






		var $body,t=(/^\d+$/.test(v)) ? v : $(v).offset().top;






		$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');






		$body.animate({scrollTop:t},500);






		return false;






	};






})(jQuery);




















$(function(){













	//$('<div style="width:100%;height:66px"><a href="http://cnrdn.com/pfeC" target="_blank" style="display:block;width:980px;height:60px;margin:0 auto;outline:none;background:url(http://g.7374.com/ui/ban980.jpg) no-repeat"></a></div>').insertBefore("#bar");






	






	//load 通用






	$("img.lazy").lazyload({threshold:10});






	$.GameSearch();






	$.TopCmd();






	$('#gotop').click(function(e){






		e.preventDefault();






		$.TopTo();






	});




















	var rel,fid;






	rel=$('body').attr('rel')||'';






	fid=$('body').attr('fid')||0;






	if(rel=='index'){






		$.include('js/index.js?v2',function(){






			$.gindex();






		});






	}else if(rel=='catlog'){






		$('#kindsopen').click(function(){






			$(this).parents('.topik').removeClass('topikclose');






			$(this).hide();






		});






		$('#kindsclose').click(function(){






			$(this).parents('.topik').addClass('topikclose');






			$('#kindsopen').show();






		});






	}else if(rel=='album'){






		var e,n,p,h;






		e=$('#addTofav');






		n=e.attr('aname');






		p=e.attr('apic');






		h=e.attr('ahref');






		e.click(function(e){






			e.preventDefault();






			$.addfav(p,h);






		});






		$.bshare('#abshare',h,{






			'bdDes':n+'小游戏合集，全都是'+n+'相关的小游戏，很好玩 - 7323小游戏',






			'bdText':n+'小游戏合集很全啊，都可以在线玩，值得一玩！',






			'bdComment':n+'小游戏合集不错，很给力！推荐给大家玩一下。',






			'bdPic':p






		});






	}else if(rel=='kinds'){






		$('#addTofav').click(function(e){






			e.preventDefault();






			$.addfav($(this).attr('aname'),$(this).attr('ahref'));






		});






	}else if(rel=='game' || rel=='flash'){






		$.include('js/game.js?v9',function(){






			if( rel=='flash' ){






				window.Game=$.Game(1);






			}else{






				window.Game=$.Game();






			}






		});






	}else if(rel=='service'){






		$.include('js/service.js?v2',function(){






			$.Service();






		});






	}













	






	/*






	$(window).load(function(){






		var usarr=['','5604983981','5604999943','5604999923','5604999883','5604999863','5604999843','5604999743','5604999663'];






		var uskey=Math.floor(Math.random()*7);






		var usurl=usarr[uskey] ? usarr[uskey] : '';






		usurl = 'http://www.youdianyisi.com'+(usurl=='' ? '' : '/view/'+usurl+'.html');






		$('<iframe name="uys_ifm" id="uys_ifm" src="'+usurl+'" style="display:none"></iframe>').appendTo('body');






	});*/



























});